package com.tarena.ELSFK.day01;
/**
 * ip: 192.168.10.23
 * d1 = 192
 * d2 = 168
 * d3 = 10
 * d4 = 23
 * 将 d1 d2 d3 d4 拼接为 1个 32位数 IP地址
 * 
 * a = 0
 * r = 104
 * g = 95
 * b = 191
 * int color = 00685FBF
 */
public class Demo06 {
	public static void main(String[] args) {
		int d1 = 192;//00000000 00000000 00000000 11000000 
		int d2 = 168;//00000000 00000000 00000000 10101000 
		int d3 = 10; //00000000 00000000 00000000 00001010 
		int d4 = 23; //00000000 00000000 00000000 00010111 
		int ip;//      11000000 10101000 00001010 00010111 
		//ip = (d1<<24)+(d2<<16)+(d3<<8)+(d4<<0);
		ip = (d1<<24)|(d2<<16)|(d3<<8)|(d4<<0);
		System.out.println(Integer.toBinaryString(ip)); 
	}
}





